package com.mk.admin.controller;

import com.mk.admin.log.WriteLog;
import com.mk.admin.model.ResultDto;
import com.mk.admin.model.query.DoctorEvaluateQuery;
import com.mk.admin.model.vo.DoctorEvaluateVo;
import com.mk.admin.service.DoctorEvaluateService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/doctorEvaluate")
@Api(tags = "医生评价")
public class DoctorEvaluateController {
    @Autowired
    private DoctorEvaluateService doctorEvaluateService;

    @PostMapping("/select")
    @WriteLog("医生评价查询")
    public ResultDto select(@RequestBody DoctorEvaluateQuery query) {
        return doctorEvaluateService.select(query);
    }

    @PostMapping("/patient")
    @WriteLog("患者对医生评价查询")
    public ResultDto patient(@RequestBody DoctorEvaluateQuery query) {
        return doctorEvaluateService.patient(query);
    }

    @PostMapping("/add")
    @WriteLog("医生评价增加")
    public ResultDto add(@RequestBody DoctorEvaluateVo vo) {
        return doctorEvaluateService.add(vo);
    }

    @PostMapping("/update")
    @WriteLog("医生评价修改")
    public ResultDto update(@RequestBody DoctorEvaluateVo vo) {
        return doctorEvaluateService.update(vo);
    }

    @PostMapping("/delete")
    @WriteLog("医生评价删除")
    public ResultDto delete(@RequestBody DoctorEvaluateVo vo) {
        return doctorEvaluateService.delete(vo.getId());
    }

    @PostMapping("/status")
    @WriteLog("医生评价状态")
    public ResultDto status(@RequestBody DoctorEvaluateVo vo) {
        return doctorEvaluateService.status(vo.getId());
    }
}
